﻿using AdminStystem.Domain;
using AdminSytem.Application;
using AdminSytem.Application.Dto;
using AdminSytem.Application.Slaughters;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace AdminSytem.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SlaughterController : ControllerBase
    {
        private readonly ISlaughterServices slaughterServices;

        public SlaughterController(ISlaughterServices slaughterServices)
        {
            this.slaughterServices = slaughterServices;
        }
        [HttpPost]
        public async Task<ResultDto<int>> AddSlaughter(SlaughterDto dto)
        {
            return await slaughterServices.AddSlaughter(dto);
        }
        [HttpGet]
        public async Task<ResultDto<Slaughter>> GetSlaughters(int id)
        {
            return await slaughterServices.GetSlaughters(id);
        }
        [HttpPost]
        public async Task<ResultDto<int>> AddSEnterprise(SEnterpriseDto dto)
        {
            return await slaughterServices.AddSEnterprise(dto);
        }
        [HttpGet] 
        public async Task<ResultDto<SEnterprise>> GetSEnterprise(int id)
        {
            return await slaughterServices.GetSEnterprise(id);
        }
    }
}
